package com.flejay.service.example;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.flejay.dao.example.IEmployeeDAO;
import com.flejay.model.example.Employee;

@Service("employeeService")
@Transactional
public class EmployeeServiceImpl implements EmployeeService{

	@Autowired
	IEmployeeDAO employeeDAO;
	
	@Override
	public void persistEmployee(Employee employee) {
		employeeDAO.persistEmployee(employee);
		
	}

	@Override
	public void updateEmployee(Employee employee) {
		employeeDAO.updateEmployee(employee);
		
	}
	@Override
	public Employee findEmployeeById(long id) {
		return employeeDAO.findEmployeeById(id);
	}

	@Override
	public void deleteEmployee(Employee employee) {
		employeeDAO.deleteEmployee(employee);
		
	}

	@Override
	public List<Employee> findByAge(long age) {
		return employeeDAO.findByAge(age);
	}

}
